     *
     * @return {Array}
     ###
-    getMessagesByAccount: (accountID, first, last) ->
+    getMessagesByAccount: (accountID, first = null, last = null) ->
+        sequence = _messages.filter (message) -> message.get('account') is accountID
+        if first? and last?
+            sequence = sequence.slice first, last
+
         # sequences are lazy so we need .toOrderedMap() to actually execute it
-        _message.filter (message) -> message.get('account') is accountID
-        .toOrderedMap()
-        .slice(first, last)
+        return sequence.toOrderedMap()
+
 
     getMessagesCountByAccount: (accountID) ->
-        _message.filter (message) -> message.get('account') is accountID
-        .count()
+        return @getMessagesByAccount(accountID).count()
 
     ###*
-    * Get messages from mailbox
+    * Get messages from mailbox, with optional pagination
     *
     * @param {String} mailboxID
     * @param {Number} first     index of first message

    *
    * @return {Array}
    ###
    getMessagesByMailbox: (mailboxID, first, last) ->
        # sequences are lazy so we need .toOrderedMap() to actually execute it
        _message.filter (message) -> mailboxID in message.get('mailboxIDs')
        .toOrderedMap()
        .slice(first, last)

    getMessagesCountByMailbox: (mailboxID, first, last) ->
        # sequences are lazy so we need .toOrderedMap() to actually execute it
        _message.filter (message) -> mailboxID in message.get('mailboxIDs')
        .count()

    getMessagesByConversation: (messageID) ->
        idsToLook = [messageID]
        conversation = []
        while idToLook = idsToLook.pop()
            conversation.push @getByID idToLook
            temp = _message.filter (message) -> message.get('inReplyTo') is idToLook
            idsToLook = idsToLook.concat temp.map((item) -> item.get('id')).toArray()

        return conversation

        handle ActionTypes.REMOVE_ACCOUNT, (accountID) ->
            AppDispatcher.waitFor [AccountStore.dispatchToken]
            messages = @getMessagesByAccount accountID
            _messages = _messages.withMutations (map) ->
                messages.forEach (message) -> map.remove message.get 'id'

            @emit 'change'
