Remove unnecessary code from test files