refactoring user model and angular templates