Minor refactoring and documentation tweaks.