Added i18n support. Code cleanup