Remove unused import
Remove unused variable
Fix abuse of global variables