moved programming logic from layout (and i18n!).