refactoring
work in progress on tcp-networking