state: improve allocations