Implemented separate function for path split.