Refactor IMsg.remove API