Refactoring and added a class that will handle user dialogues