Refactoring javascript to use promises