refactor for Agenda and Index