bmatusiak: I would probably do something like https://gist.github.com/3104543