Extract shared code into private function. See how Code Climate likes that :-)