Have you explored the CourseFactory to see if that would make this easier? I'm still not very skilled with the CourseFactory myself.