Restructured the location of character to command mapping.