Modularized the iterator module.