Add max smilies and code cleanup