pass in flatten/processing function into _connect_in/out