set up main and run methods on message threads