- Change boolean parameter name from 'trim' to 'isTrim' for better clarity - Simplify output comparison logic by inlining ternary expression