Cleanup implementation