code refactor: add path func