make the create_activity method slightly more generic