Clean up helper functions.