move localization to helper method