Refactored common patterns.