refactoring AngularJS and CSS code