refactoring prefkeys