Use dependency injection so class can be unit tested.