improve type system