Some code refactoring and a documentation rebuild.