Abstracted a bunch of locale related code