dirs refactor