utilized async library to refactor code