refactor agent goofy