some minor improvements that may have slight influence on performance