Proper placement of the logic to filter empty courses