Move some logic to generator init method