Urgh this diff is confusing, just remove the code duplication.