clean up and beef up globals