Reorganize and add better comments to modules