Identified and fixed several bottlenecks