Improve keyword_patterns