refactor the directory