let's rewrite using promises