Is it reasonable to introduce new identifier _sig for each signal sig? You could just make emit private static function,that takes signal by the first argument instead.