Minor refactorings & documentation