cleanup logic for abstrace classes