Get rid of global variables

Can’t init callbacks because of strict mode
maybe just make these callbacks required?