Attempt at seperating js from template