Created IO interface and refactored ConsoleUI