IMHO move the field.equals(titleField) check here could make the code more readable