 		next?._previous = previous
 		if @_first is element then @_first = next
 		if @_last is element then @_last = previous
-		@_size--
+		@_pageCount--
 		return
 
 	_clearElements: ()->
 		@_first = @_last = null
-		@_size = 0
-		return
-
-class Page extends LinkedList
-	loaded: false
-	entityCount: 0
-
-	constructor: (@entityList, @pageNo)->
-
-	initData: (json)->
-		rawJson = json
-		entityList = @entityList
-
-		if json.hasOwnProperty("$data")
-			json = rawJson.$data
-		else if json.hasOwnProperty("data$")
-			json = rawJson.data$
-
-		if json and not (json instanceof Array)
-			throw new cola.Exception("Unmatched DataType. expect \"Array\" but \"Object\".")
-
-		if json?.length
-			dataType = entityList.dataType
-			for data in json
-				entity = new _Entity(data, dataType)
-				@_insertElement(entity)
-
-			if rawJson.$entityCount?
-				entityList.totalEntityCount = rawJson.$entityCount
-			else if rawJson.entityCount$?
-				entityList.totalEntityCount = rawJson.entityCount$
-
-			if entityList.totalEntityCount?
-				if entityList.pageSize
-					entityList.pageCount = Math.floor((entityList.totalEntityCount + entityList.pageSize - 1) / entityList.pageSize)
-				entityList.pageCountDetermined = true
-
-			entityList.entityCount += json.length
-			entityList.timestamp = cola.sequenceNo()
-
-			entityList._notify(cola.constants.MESSAGE_REFRESH, {
-				data: entityList
-			})
-		else
-			entityList.totalEntityCount = entityList.entityCount
-			entityList.pageCountDetermined = true
-		return
-
-	_insertElement: (entity, insertMode, refEntity)->
-		super(entity, insertMode, refEntity)
-
-		entityList = @entityList
-		entity._page = @
-		entity.parent = entityList
-		delete entity._parentProperty
-
-		if not @_dontAutoSetCurrent and not entityList.current?
-			if entity.state isnt _Entity.STATE_DELETED
-				entityList._setCurrentPage(entity._page, false)
-				entityList.setCurrent(entity)
-
-		entity._setDataModel(entityList._dataModel)
-		entity._onPathChange()
-		if entity.state isnt _Entity.STATE_DELETED
-			@entityCount++
-			@totalEntityCount++
-		return
-
-	_removeElement: (entity)->
-		super(entity)
-		delete entity._page
-		entity._parent = entity.parent
-		delete entity.parent
-		entity._setDataModel(null)
-		entity._onPathChange()
-		if entity.state isnt _Entity.STATE_DELETED
-			@entityCount--
-			@totalEntityCount--
-		return
-
-	_clearElements: ()->
-		entity = @_first
-		while entity
-			delete entity._page
-			entity._parent = entity.parent
-			delete entity.parent
-			entity._setDataModel(null)
-			entity._onPathChange()
-			entity = entity._next
-		@entityCount = 0
-		super()
-		return
-
-	loadData: (callback)->
-		providerInvoker = @entityList._providerInvoker
-		if providerInvoker
-			providerInvoker.pageSize = @entityList.pageSize
-			providerInvoker.pageNo = @pageNo
-			if callback
-				providerInvoker.invokeAsync(
-					complete: (success, result)=>
-						if success then @initData(result)
-						cola.callback(callback, success, result)
-				)
-			else
-				result = providerInvoker.invokeSync()
-				@initData(result)
-		return
-
-class cola.EntityList extends LinkedList
-	current: null
-	entityCount: 0
-
-	pageMode: "append"
-	pageSize: 0
-	pageNo: 1
-	pageCount: 1
-
-	_disableObserverCount: 0
-
-	# totalEntityCount
-	# _parent
-	# _parentProperty
-	# _providerInvoker
-
-	constructor: (array, dataType)->
-		@id = cola.uniqueId()
-		@timestamp = cola.sequenceNo()
-		@dataType = dataType
-		if array then @fillData(array)
+		@_pageCount = 0
+		return
 
 	fillData: (array)->
 		page = @_findPage(@pageNo)

		@timestamp = cola.sequenceNo()

		if setCurrent
			entity = page._first
			while entity
				if entity.state != _Entity.STATE_DELETED
					@setCurrent(entity)
					break
				entity = entity._next
		return

	_onPathChange: ()->
		delete @_pathCache

		page = @_first
		if !page then return

		next = page._first
		while page
			if next
				next._onPathChange()
				next = next._next
			else
				page = page._next
				next = page?._first
		return

	_findPrevious: (entity)->
		return if entity and entity.parent != @

		if entity
			page = entity._page
			previous = entity._previous
		else
			page = @_last
			previous = page._last

		while page
			if previous
				if previous.state != _Entity.STATE_DELETED
					return previous
				else
					previous = previous._previous
			else
				page = page._previous
				previous = page?._last
		return

	_findNext: (entity)->
		return if entity and entity.parent != @

		if entity
			page = entity._page
			next = entity._next
		else
			page = @_first
			next = page._first

		while page
			if next
				if next.state != _Entity.STATE_DELETED
					return next
				else
					next = next._next
			else
				page = page._next
				next = page?._first
		return

	_findPage: (pageNo)->
		if pageNo < 1 then return null

			page = @_findPage(pageNo)
			return @ unless page

		i = 0
		while page
			for entity in page
				if deleted or entity.state isnt _Entity.STATE_DELETED
					if fn.call(@, entity, i++) is false then break
			if not pageNo
				page = page._next
			else
				break
		return @
