Clean up code moved up in tests