Using page cache and AppendIterator, refactoring code
Added licence