Refactor file shortcut generator and tcpcommand