Updated to use path parsing functions