more elegant field search logic