added Factory Pattern