Massachusetts Republicans encouraged by legislative gains