Refactor angular