Fix tests (by extracting a method and calling it multiple times)