Dedup the code

The blocks were 100% same only the list they iterate
was different.