LearningAgent code cleanup