cleanup redundancy with setting maxsize