Various updates to program flow improving readability, performance, and consistency between files.