Moved the emoticon logic to the internal function

Moved the emoticon logic to the internal function