Constructor and desctor for global objects