LUN-670 -- optimized format_recursive_msg