Reuse str_format function