Factored out duplication