Base doc and refactor