[grader.js] Refactoring