General readability refactoring

Just some general linter refactorings and organizational fixes to help me learn the code.