cleaned up activities and queries