Refactor some of the angular stuff that was becoming obviously repetitive.