refactor emoticons code