some output optimizations