More documentation ans some refactoring to aid documentation.