extend variables and improve tests