Various fixes

Fixes include removing unused imports, refactoring file names and variable names and consistency fixes.
Oops.