Something along the lines:
static NSMutableDictionary* NSMutableDictionary createQuery(id class, id service, id account) {
...
}
Providing we cover all the parameters for all the methods, such as kSecReturnData, kSecReturnAttributes, kSecMatchLimit, kSecAttrAccessGroup and not constrain the query.