[TASK] Refactored to use Promises instead of callbacks.