Code Clean-up and documentation.