testability

Refactoring patterns for hard-to-test code