Get rid of global counter