refactoring adapter and activity