I would prefer that you move these into the section of code that needs them (it is only one case, and I'm not even sure why student_view with children needs the course).