added class TypeFactory.php