Minor refactor and documentation.