some performance optimizations