Refactor make dir