Quick refactoring pass, break out keys into groups, and update the relevant scripts