language selection refactor