extracted parent class to reduce code duplication