extract_keywords and add_synonym refactoring