better resource object handling