cleaning up
move some code around in test