refactoring: extract method
simplify regex