optional refs assignment improved