Final code refactor to match angular style guide