getPath refactory