simplified functions and fixed identifier regexp pattern