I don't really understand this function, it's too much complex.

Can you tell me what you're trying to achieve here? What this function is supposed to do?

Also, I saw you replaced all occurences of findByPhoneNumber by findByAddress, and as a result findByPhoneNumber is not used at all. That's why I'd like to understand what you're trying to do here.