Added 3 cleanup functions