code encapsulatet in a protected function