more general pattern for capturing sig function