     ###
         Public API
     ###
-    getAll: -> return _message
+    getAll: -> return _messages
 
-    getByID: (messageID) -> _message.get(messageID) or null
+    getByID: (messageID) -> _messages.get(messageID) or null
 
     ###*
-    * Get messages from account
+    * Get messages from account, with optional pagination
     *
     * @param {String} accountID
     * @param {Number} first     index of first message

    *
    * @return {Array}
    ###
    getMessagesByAccount: (accountID, 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)

    getMessagesCountByAccount: (accountID) ->
        _message.filter (message) -> message.get('account') is accountID
        .count()

    ###*
    * Get messages from mailbox
    *
    * @param {String} mailboxID
    * @param {Number} first     index of first message

        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'
