substituted some val args with ref args