angular ui refactor