Update thread

isolated the rendering and update loops