Some optimizations for output