refactor & fix Locale extension