tests cleanup, remvoved dead code, added more tests