generator.py: Made most methods private