add Factory.php to handle all type