Moved rendering to its own thread