Wrap TypeState in a module