Refactoring and print