It looks like this repeated code could be factored out into a function, too.