refactor agent view to better use reactive