factory and abstract factory design pattern