ABC.

Use ABC (abstract base classes) to consolidate identical functions.
Also, refactor names.