refactored promises
Merge pull request #177 from jabadia/refactor-promises

refactored promises