tests on tests on tests

also some refactoring, cleaning