Move aux function to test (used only in the test cases)