This and the one above look like good candidates for an abstract base class or a mixin given the similarities.