refactoring and manually setting encoding to UTF-8