Using methods to handle output. More refactoring.