extracting before logic to base class