Refactor into course-agnostic helper methods