Added history defragmentation