Output formatting and more cleanup