refactor directory tree