Pass the objects as parameters to the function, or better yet pass the interface that they implement. You would not tie the objects to the function in this way.
Event if this is more about dependency injection then loose coupling, it would not hurt making the change.