new stop condition handling and cleanup for minimizer