minor perf/mem fix