Documented functions
Some code cleaning
Minor cleaning and TODO update