delete duplicated logic
update sync function to async