Completed updateRef method.