regexps  and refactoring