moved helper function from base class