making code testable