Clean up use of promises