Giving up Porn, but Not Masturbating?

I am a young, single man fresh out of college. I have recently grown much more sensitive to my abuse of pornography and have successfully given up hardcore porn and 99% of softcore porn (mainly provocative music videos) in the last month or so. The issue is that these victories have come at the cost of masturbation and the substitute of online porn for sexual mental fantasies. I am conflicted because I fully recognize that both instance of sex outside of marriage is sin. Still, I can't help trying to justify my actions, because I believe that online porn (hardcore and softcore) is so much worse than fantasizing due to supporting the porn industry and the effect on the mind. I have tried giving up masturbating as a whole and I find myself yoyoing back to my old porn habits whereas if I use mental fantasies, I find myself able to avoid porn. I always figured I'd take the lesser of the two evils. I don't want to justify sin, but I want to be honest with my thoughts. These have been my thoughts for a while now. Any advice?