[core] better capitalization function