reorganized comm code into model, view and event_handlers