Refactoring the CandidateElementExtractor