Move shared code to activity.partial