Cleaned up generator template