corrected abstract factory and added builder pattern implementation