optimize object allocations