Refactored a bunch of code to help make all files follow consistent code standards