Code refactoring. Add utf8 encoding