code cleanup in activities and events controllers