Console app, refactoring