added a factory design pattern abstract for examples in class