angular refactor