Refactored locale implementation to be simpler