docs, minor refactoring