minor cleanup: require things at the top
use pend instead of async