Improved code layout and formatting in AIDirector.