First crack at refactoring PDF