Factor out unnecessary lines from tests