It would be nice if this was implemented without a generator but I think this is OK for now.