small code simplification and new locale standard