Source code formated, cleaned and modified to met some conventions