Fix unused imports and local variables

This pull request fixes unused use statements and removes unused local variables