restructured references, getting ready for socket