Refactor to be common code into base classes/tables