made the class unit testable and and the free method