Removed unnecessary locals
Removed unused imports