moved AI to AppModel