small changes for some speed-up