add activities and refactoring