some cleanup and also support executing characterwise selection and termination