pulled out port communication to its own file