This should be way cleaner now. no private function any more, just compute it here.