remove unused global statement
a few more cleanups