code refactored in course_spec

master_1