simplify cpp completion request handler logic