Keys refactor