Moved global initializations away from require/main