Minor refactoring to avoid a temp variable.
Removed unused class.
Tried to improve some naming.