changed prototype.constructor of factoried classes, because I think it is more suitable for further inheritance of created classes.