Refactored the code to be more angular. Separated templates into layout and partials