Improved the doc and layout of some functions