reorganize test functions

Cleanup  a bit.