Refactored code to use Pattern constants