Clean up the API for "lazy" optimizations