refactor of angular application code