add promise based stuff and refactor out a service