adapting unit tests

minor code fixes
unit tests WIP
tests reorg
test WIP