Bunch of speed improvements