this is a little confusing. since only used once, worth doing inline? 

otherwise it needs docs and `try/except`s (and possibly moving the outside `type` call in here?)