Revert 181ca22..d3d6bde

This rolls back to commit 181ca22a7ce8210e2f506924e5f058485b24027d.
Optimization fix