small speed improvements