abstract factory and factory design pattern added