Slight change to allow widget init code to be written to a different writer