tested allDocuments call at document level + improved helper function
'createParamsObject'