Refactor how keys work