added replacePath and renamed basePath to prependedPath