Refactor SearchDocument listeners.