Several things

- Add documentation
- Small refactor