Refactor and extend localization infrastructure to support controls