Fix bugs in cloneContents and extractContents by defining abstract algorithms