refactor the directory list