Optimize AEM model