Refactor title formatting code.