Set sage and ref fields in constructor