Only one repeated statement is left: the one to get the chain of stacked_on branches. This is a tricky one because the information here is recursive but we should be able to prefetch that data too.
Only one repeated statement is left: the one to get the chain of stacked_on branches. This is a tricky one because the information here is recursive but we should be able to prefetch that data too.