Refactor judge