key refactor