strings localization and minor code refactoring