Extracting directory method