Updates doc.
Minor refactoring.