Moved AI direction logic and priority logic into other classes