save rough draft of type system refactoring