Minor refactorings and documentation enhancements