refactored dir