tidy and remove some test code
tidy