cleanup of messages.rb