some small performance improvements