moving code to SlotViewer class
organized communication code, fixed compiler warnings