Minor perf. improvement and cleanup