Refactor Angular code in relation to style guide