refactor to integrate into coursegen