Moved client control port code to new file