use promise instead of callback. WIP