regex groups, refactoring