Further refactoring of the language filter plugin