Examples of how to write testable code