refactor pdf feature