started extracting directory functions