Code cleanup, output cleanup, and more OO