generic trash implementation + unitests