* AI code cleanup part 1.