refactor to use Promise.method