various small speed up changes