Optimize extensions (unfinished).