acosta.87 :
You’re giving him bad advice. He would only need to change the GPU as the i5 8400 is more than capable of driving even much more expensive GPUs.
Some bench on the two CPUs for gaming: https://www.reddit.com/r/Amd/comments/79mcbs/core_i5_8400_vs_ryzen_5_1600_overclocked_gaming/
For 720p, yes, 8400 is much better. For 1080p, almost no diff. If you think your build is better, just show it to us. With high price of Z370 MB, I doubt you can fit in a better GPU with the same budget with 8400.