Tips to use generators safely