Implemented factory classes, new graphics code