ruby rewrite of producer