Handle refs inside contained