Select two aggregate functions on the same column using different criteria - performance
There is a trick you can use to filter aggregates:

select
 --...
 , sum(case when CONDITION THEN 1 ELSE 0 END) AS FilteredCount
 , sum(case when CONDITION THEN SomeCol ELSE 0 END) AS FilteredSumOfSomeCol


If you can fit your aggregates into this scheme you can avoid the need for repeated query parts like in the current code. It looks like you can use this trick.