Extract function to capitalize special words