move setting of globals to initialization time