Make code more testable?