removed unused imports, vars and references found by pyflakes