Move AI stuff to own file