minor code improvements in tests