big refactor, I finally understand what is going on with 5, documented internally