some cleanup and makes timeout more integral to allow better control of receiving messages