Some refactoring in PDF mark-up