Some refactoring of the key system. (rendering and processing; renaming of vars)