added type parsing