simplified code, using async/await