optimized toString while maintaining consistency