cleaning up test code with auxiliary methods