clean-up helpers and their various implementations