Refactor dependencies to independent classes