refactor type fn for readability/brevity
Merge pull request #251 from zzmp/refactor-type-fn

Refactor type fn for readability/brevity