extracted messagelistener and finished pur