housekeeping and test code