Code clean up

Removed unused and useless code 
Refactored