switched flow.hs to Output director pattern