Activity refactoring