wonder if all this big tree can be wrapped each block into a method to refactor nicely the sections like elsewhere is done as this is getting too long