FlowFactory design pattern demo