small refactoring of locale