With Sam, simplify/improve "type"'s implementation