remove unnecessary globals