Avoid unnecessary allocations and method calls