Refactor and print