Pass objects to methods accepting them instead of relying on global objects.