See about replacing this with angular.extend