Add doc + refactor + fix formatting
Add doc