improved the message / appointment model