Minor code cleanup

I was inspecting the codebase to figure out something when I saw a few IntelliJ suggestions. Eventually, I ran the inspection tool and went through the enormous list of possible issues. I think these are changes for the better. Please let me know, if you do not agree with some of the types of changes, I can modify the PR to make everyone happy.
what was the reasoning here?