cleaned up unittest code