Add documentation and minor code-refactoring

Not relevant anymore