Refactor lib\path.py