Encapsulate display and deallocate threads in classes.