clean up plugin to use callback mechanism of ice instead of polling. Handle text messages