refactor and clean up docs