Reorg module classes, update HTML patterns