rewrite router async logic