Replace code with rmdir module