factor out display logic for generate into print functions