a lot of refactoring of keys, locks, and buttons