Refactored callback-hell into promises.