make constructor args optional
fixed some code duplications and wrong superclasses