added logic to skip extraction of a path, if it is simply the common prefix path