More cleanup, beginning global var usage