tidy up testing code