please put this refactoring in a separate patch.