better use of new type system