More $emessage removal and code clean-up