extract Pend into a separate module