Adding cyrillic supporting and refactor