code refactor for one less ng-repeat