Refactor Collection::extract to reduce branch depth & add documentation