Refactor to using promise based call chaining