use is_* methods instead of type attribute for Message class