I am working on a complex query that contains a common table expression and multiple subqueries. I am trying to keep the code readable by splitting it into methods but I am stru