large scale speed improvements