refactor file path persistence handling