Refactoring : add comments and change the name of some functions.