refactoring output methods to improve codeclimate grade.