restyle language selector and optimize scripts