add some performance optimizations