Refactoring DirectoryActivity