Cleaning up promises and tests in serviceFactory