Exercise "Mail server model". Code refactored.