Optimized Code in Browse Courses Page