Added message object and tidied up all events and commands