clean up cache code in agenda a bit