converted to unittests