Some refactorings
Add to new documentation