Remove N+1 issue from Department db query