Finished refactoring to use global sendUIMessage() method instead of repeating boilerplate message code everywhere.