Refactor test code to reuse in other suites