Refactoring: Separated function in processCourse