refactor(promises) use q.Promise instead of deferred