Docs and tiny refactoring