refactoring console output