refactoring promise angular for multiple promise