refactored generator methods to return pdf