improved test functions