Some refactoring to make internationalization easier.