Code cleaned and optimized

Cleaning code basically