regex,other primary improvements