fixing up layer connection sequence, to use intermediary query model