preparing to make it more unit testable