Add documentation
Code cleanup