got rid of a few globals