use fewer globals