Refactored and broke out restangular code