refactored code and generate locale files