Move globals into namespace