tidy up code for test