from the looks this refactoring is not at all related to the rest of this PR. can you extract it and submit a separate PR for this? If you do so, please mention me that we can get it merged quickly.