WIP: refactor PmtaConnection