refactoring regex