Refactoring, localization fixes