look into duplication of directory logic