Code cleanup, better emoji support