total review

separate code into 2 classes