refactor regexps