Code cleaning inside the agent