Refactor locale provider