extract Sprintf to helper func