refactor comparison and add status code