Add clean function

--HG--
extra : amend_source : 116d9007859cce154054ed8f23c41f40b431bf19