refactor to put-directory