refactored language listener