better _remove{,_all} code, should be correct