Refactor async function without anon function