Begin to refactor key system