moved global constants into globals