Cleanup utility functions