What I am trying to say is. An ex is an ex. It's over, It's done, finished.
Unless there are children under 18 there is no reason to remain friends.
Maybe you have a different way of thinking, and care for him, or feel sorry for him.
Then ok, you became just friends.
I can never do what you are doing.
I'm not saying that you are doing anything wrong, I'm only telling you what I would do.
What you do is your own choice.