Clean up and prepare for test framework