A couple of performance improvements