changed structure of classes a little