Refactor pdf decorator.