removed emit function, moved impl into async function