separated path resolution logic and resource loading logic in engine::resource.