Cleanup
Rework handling of output