replace Q stuff using CPS control flow