Docs, refactoring, improvements