update documentation, minor refactor & bugfix