Also, why not make this code block a helpers method, so other projects can just call it instead of cutting and pasting ?