I was copying code style from elsewhere - but use of a generator sounds generally good.