refactor test util functions (prepare for mixed tests)