handleMessage() shall be changed in the future to replace messageOut() and messageIn()