Refactored to include pattern