also splice out this logic outside of the CB into a named func