Move this to a method. The linq expression was much smaller before.