try to enhance performance for at least get_courses() query

Rather than introduce this, make the change below.