Refactor activities.