documentation and code cleaning