Rename copy to copy-and-flush and refactor slightly.