refactored resolving of path and its usage