refactor path/config resolving