Cleanup global variables management