some work toward querying the activity table directly