Removed helper function and called `resolve()` directly.