Revert "Refactor the code a bit to make it more readable and clean."

Authored by mwolff on Sep 6 2016, 4:07 PM.