tests small refactoring
tests: big refacroting
tests bugs fixed