extracting behavior into base class