added pathToObj function and some code refactoring
Merge branch 'path-to-object' into develop