move reference resolution logic into dedicated ReferenceResolver class
implement ReferenceResolver$forceResolution
fix test