cleanup of adapter