keystone refactoring