some performance improvements