Extract duplication to module.
Merge pull request #5 from gavinlaking/feature/duplication

Extract duplication to module.