Lots of general cleanups, clearer printing functions