some tidying and refactoring for localization