Style fix.
Eliminated unused variable.
Eliminated unused variables.
Refactored to reduce method complexity.