Add some performance optimizations