I'd suggest somthing like this:
https://gist.github.com/nickvergessen/66b4bc7bb3541e425717