Code cleanup behavior tree