refactor predicateFromDictionary