Replace id's by css classes and cleanup