Documentation update and minor refactor.