inherit defaultResourceName if not set + cleanup