added exit messages - refactored