refactoring by_key
added load_by_key
 refactored out  rescope