Drafted implementation of cleanup.