Clean up id processing