refactoring section, activity and flag