extract blob conversion function into util method