 //            }
         case .MessageRecord:
             //return countOfFilteredUserMessages
-            let count = countOfFilteredUserMessages
-            if count > 0 {
-                if !isMoreUserMessagesFold {
-                    return count + 1
-                }
-                if count > Section.maxNumberOfItems {
-                    return Section.maxNumberOfItems + 1
-                } else {
-                    return count
-                }
-            } else {
-                return 0
-            }
+            return numberOfRowsWithCountOfItems(countOfFilteredUserMessages, fold: isMoreUserMessagesFold)
+
             //return filteredMessages?.count ?? 0
 //            if let count = filteredMessages?.count where count > 0 {
 //                return count + 1

            return 0
        }

        switch section {
        case .Friend:
            //return filteredFriends?.count ?? 0
            let count = countOfFilteredFriends
            if count > 0 {
                if !isMoreFriendsFold {
                    return count + 1
                }
                if count > Section.maxNumberOfItems {

//            }
        case .Feed:
            //return filteredFeeds?.count ?? 0
            return numberOfRowsWithCountOfItems(countOfFilteredFeeds, fold: isMoreFeedsFold)

//            if let count = filteredFeeds?.count where count > 0 {
//                return count + 1
//            } else {
