Exit intelligently