Add refernce resolving for where