Refactor directory