improved openResource() and related methods