lots of changes to support localization