WIP clean up agent logic