Refactor partial directory dealings.