Refactor PDF search service.