documentation updates and refactoring continued