document base/extend and refactor extend