proxy: minor reorg, move glue to separate file