cleanup and debug supersede utility functions