move static function out of class, that improved golang's recursive function performance significantly