refactor language switch.