refactoring GetKeys
reorganizing spec