refactor evaluation js