Small performance improvments