@Jasperg I hope you'll find the solution for your question. It may be a combination of all the topics mentioned.
It helped me a lot the last three years to look into the RRF code to understand it. This is all open source, so it is also changeable by oneself, so there is freedom to implement own ideas. For example, I added some logging to the console here and there (and recompilation) to understand the code better, especially what the different variables mean. Maybe you want to go a similar route like me.