Move common init into a static function.