Ex boyfriend's best friend

B is my ex, Z is his friend
Should I feel bad for talking to Z? Flirting/being interested in him I mean. He cut me off a few weeks ago because he realized I'm his "best friend's ex girlfriend." his words, not mine. We broke up 5 years ago, dated for 3 years. But today Z's hitting me up like nothing ever happened.
I personally dislike my ex boyfriend. He was incredibly emotionally, mentally, and physically abusive. BUT I respected Z's decision to stop talking to me because y'know, if he doesn't wanna talk to me he doesn't wanna talk to me, whatever..
But if he REALLY wanted to stop talking to me, I would think he wouldn't be snap chatting me right now? Idk I'm definitely interested in him. My ex is not a priority of mine anymore and I personally don't think I should give a rats ass about his feelings after all of the shit he put me through. Z must not care too much either since he's still reaching out to me. Idk, is that shitty of me?😅 What would you do in my situation?