improve type parsing