I might not have the full context, but it seems like the data in attr a list of lists of stuff, some of which is url-encoded. Rather than pulling out stuff and selectively unqoting it when you find a bug, wouldn't it be better to take stuff out of attrs, unquote it, and assign it to variables with meaningful names at the top of the function?