Remove bottlenecks found from profiling snapshots

Uncategorized

Various speed bottlenecks have been removed to improve performance.