Code cleanning
Removed global variables
Improved exception hadling
Cleanned all warnings using pylint