Docs and small refactor