refactored the printer page and the document generator.