Abstracting out duplication