finalize references.