Utility method for printing