refactor and localization