Internal optimization