Simplification of Angular code