test: move helper methods for sub test cases to the top of the parent test case