Refactored Patterns class