Changed names of methods, added checking for capture groups