Change scope to ref