Cleaning up some message factory code. Removing deprecated method calls.