Tbh, I still think we could split this into multiple methods to make it more readable.

In any case, I also want to move on with this great feature, merge it asap and start working in splitting it into a separate module.