cleanup
refactoring handy functions