optimize doc structure