better way to use async