Refactor to use React/Promise instead of a custom implementation