Reorganize transport.js