further refactoring for path to record conversion.