Some minor refactoring
Documentation improvements