fix rm and allow testing of private fns