Refactored capitalize-title.