minor cleanup
tweak empty insert logic