Some code cleaning for efficiency
Removed unused variable