a bit of cleanup.
move and expand tests.