I'd simplify this into a function that returns a dictionary, no need for all the extra magic :)