improve language selection mechanism