Remove unnecessary globals, ref: #4