start using promises to make the code easier to follow