Added a better way to build dicts out of struct types