worked on refactoring with dirs