Generator improvements and cleanup