Implement ipFormatSize() and cleanup code