slowly getting rid of global dependency