Further refactoring.
Add documentation.
Update documentation