refactored theory format code in ExamManager