Style, make names clearer, remove weird complexity

There were a couple sections of code that did not make sense to me. I
got rid of them because I think they were wrong, and even if not they
were not worth the risk. The more crazy stuff, the harder it is to
review a PR, and this one is already super big!