Revert "Revert "optimizations""

This reverts commit 2c4485c11da10eeac4fcff49a851849ff455173f.