added the rest code for simple Factory Pattern