we should refactor this into a base class like you suggested.