Refactoring printing into a dedicated package