Refactor common functionality into the abstract class.