Settings changer for the keyboard layout and some code clones moved to their own methods.