Docs and minor fixes
Minor refactoring