add getUnreadMessage, small refactoring

add **getUnreadMessage** method (#1)