changed the structure of the application to Command pattern and added sending message functionality with this structure