Put shared function into formSvc.