`new_field` is not needed (on line 227) unless the `if field in hit` is true. So you can move line 227 down to here.