refactor and documentation updates