fix in OO style
added unittests