Robustness enhancement on file path computation + refactoring