Template functions the easy gil way