Fix: Inefficient memory use