Simplified cleanup code