Refactored structure.

Fixed doc.