add Factory.php to handle all type
Merge pull request #3 from No5stranger/cjp

add Factory.php to handle all type