clean the codes, add validation and i18n