some fixes to to_ref, renamed to_ref to store_reduced