Some minor perf improvements