Refactor, better use of require js and handlebars