better uri/kvp to array function