refactoring the language managment