refactor pdf