Refactor and localization