Directories refactor