Exam code refact