cleaning up localization code