added code for Abstract Factory