Move promotion code generation into a reusable object.